<%@ page language="java" import="java.util.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@include file="/common/common.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>jQuery Test JSP</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link type="text/css" rel="stylesheet" href="themes/smoothness/jquery-ui-1.8.7.custom.css" />

	<script type="text/javascript" src="script/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="script/jquery-ui-1.8.7.custom.min.js"></script>
	
	<script type="text/javascript">
		jQuery(function($) {
			function sendAjaxRequest(data, callback) {
				$.getJSON("json/json-searchPerson.action", data, callback);
			}
			
			$("#submit").click(function() {
				sendAjaxRequest( { username: $("#username").val(), password: $("#password").val(), 'person.firstName': 'aa' }, function(result) {
					console.log(result);
					$("#msg").text(result.username);
				});
			});
		});
	
	</script>
  </head>
  
  <body>
	  <div id="msg"></div>
	  username: <input name="username" id="username" type="text"/>
	  <br/>
	  password: <input name="password" id="password" type="password"/>
	  <br/>
	  <input type="submit" id="submit" value="login">
  </body>
</html>
